﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 实验
{
    class Program
    {
        static void Main(string[] args)
        {
           
        }
        public static int solution2equation(double a, double b, double c, double[] solution)
        {
            double delt = b * b - 4 * a * c;
            if (delt >= 0)
            {
                if (a > 1e-10)
                {
                    solution[0] = (-b + System.Math.Sqrt(delt)) / (2 * a);
                    solution[1] = (-b - System.Math.Sqrt(delt)) / (2 * a);
                }
                else
                {
                    solution[0] = (2 * c) / (-b + System.Math.Sqrt(delt));
                    solution[1] = (2 * c) / (-b - System.Math.Sqrt(delt));
                }
                return 2;
            }
            else
            {
                return 0;
            }
            


        }
        public static int solution2equation(double[] coefficient, double[] solution)
        {
            double a = coefficient[0];
            double b = coefficient[1];
            double c = coefficient[2];
            return solution2equation(a, b, c, solution);
        }

    }
}
